package priv.pront.code.mati.province;

import java.util.Scanner;

/**
 * @Description:
 * @Author: pront
 * @Time:2023-11-11 15:09
 */
public class MC0110_曼哈顿距离矩阵 {

    static int x, y;
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        x = scanner.nextInt();
        y = scanner.nextInt();
        int n = Math.abs(x) + Math.abs(y);
        int start = 0;
        for (int i = 2; i < n; i++) {
            start += i * 4;
        }
        if (n > 0) start += 4;

        if (y >= 0 && x > 0) {
            start += x;
        } else if (y < 0 && x >= 0) {
            start += n - y;
        } else if (y <= 0 && x < 0) {
            start += 2 * n - x;
        } else if (y > 0 && x <= 0) {
            start += 3 * n + y;
        }
        System.out.println(start);

    }
}
